/*********************************************************
          File Name:us.h
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sat 19 Sep 2015 07:14:47 PM CST
**********************************************************/

#ifndef TY_H_
#define TY_H_

#include "base.h"

using std::string;

class TY final: public Human    // `final` keyword mark `TY` as non-derive class
{
        private:
                string fullname;
                string gender;
        public:
                TY() = default;

                TY(const char *fn, const char *ge): 
                        Human("null", -1), fullname(fn), gender(ge) {}

                TY(const char *n = "null", int b = -1, string fn = string("null"), 
                        string ge = string("null")):
                        Human(n, b), fullname(fn), gender(ge) {}

                TY(TY &t) :Human(t.Human::getname(), t.getage())
                {
                        fullname = t.fullname;
                        gender = t.gender;
                }

                ~TY() = default;

                virtual std::string getname() const     // derive TY version getname()
                {
                        return fullname;
                }

                string getgender()
                {
                        return gender;
                }

                int getage()
                {
                        return age * 2;     // derived class can access protected member of base calss
                }
};

class AC final: public Human
{
        private:
                string fullname;
                string gender;
        public:
                AC() = default;

                AC(const char *fn, const char *ge): 
                        Human("null", -1), fullname(fn), gender(ge) {}

                AC(const char *n = "null", int b = -1, string fn = string("null"), 
                        string ge = string("null")):
                        Human(n, b), fullname(fn), gender(ge) {}

                AC(AC &t) :Human(t.Human::getname(), t.getage())
                {
                        fullname = t.fullname;
                        gender = t.gender;
                }

                ~AC() = default;

                virtual std::string getname() const     // derive AC version getname()
                {
                        std::cout << "AC::getname() is called --> ";
                        return fullname;
                }

                string getgender()
                {
                        return gender;
                }

                int getage()
                {
                        return age * 2;     // derived class can access protected member of base calss
                }
};

#endif
